package com.woniu.liuzhougov.itemAndTask.controller;


import com.woniu.liuzhougov.itemAndTask.pojo.ItemsPojo;
import com.woniu.liuzhougov.itemAndTask.pojo.Urgenry;
import com.woniu.liuzhougov.itemAndTask.service.ItemsManageService;
import com.woniu.liuzhougov.itemAndTask.service.UrgencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("ItemUrgency")
public class ItemUrgencyController {

    @Autowired
    private UrgencyService urgencyService;
    @Autowired
    private ItemsManageService itemsManageService;

    /**
     * 查询所有事项 紧急情况
     * @return
     */
    @RequestMapping("/listUrgency")
    @ResponseBody
    public Map listUrgency(Integer itemId){
        List<Urgenry> list = urgencyService.searchAllTypeOfUrgenry();
        ItemsPojo itemsPojo = itemsManageService.searchItemByItemId(itemId);
        Map<String,Object> map = new HashMap<>();
        map.put("urgency",list);
        map.put("item",itemsPojo);
        return map;
    }




}
